<?php
//
//	file: includes/aucp/class_notify.php
//	begin: 2006-07-10
//	$Author: christopher $
//	$Revision: 29 $
//	$Date: 2008-07-19 15:59:35 +0000 (Sat, 19 Jul 2008) $
//	license: http://opensource.org/licenses/gpl-license.php GNU General Public License (GPL)
//
//	description: loader for notifications

if ( !defined('IN_PHPBB') )
{
	die('Hacking attempt');
	exit;
}

// definitions
if ( !defined('NOTIFY_CURRENT_VERSION') )
{
	define('NOTIFY_CURRENT_VERSION', '0.7.1');

	// email types
	define('NOTIFY_EMAIL_TEXT', 11);
	define('NOTIFY_EMAIL_HTML', 12);
	define('NOTIFY_EMAIL_BOTH', 13);

	// recipient types
	define('NOTIFY_TO', 51);
	define('NOTIFY_CC', 52);
	define('NOTIFY_BCC', 53);

	// BBCode UID for generating html messages
	define('NOTIFY_BBCODE_UID', 12345);
}

// login or install
if ( defined('IN_LOGIN') || defined('IN_INSTALL') )
{
	return;
}

// run install?
check_install('mod_aucp_notify', NOTIFY_CURRENT_VERSION);

// not installed
if ( !$config->data['mod_aucp_notify'] )
{
	return;
}

// version
class advnot_version
{
	function read(&$data)
	{
		$data[] = array('app_name' => 'AUCP Notifications', 'app_desc' => '', 'app_marker' => 'mod_aucp_notify', 'app_author' => 'impleri', 'app_author_url' => 'http://impleri.net/', 'app_server' => 'mods.impleri.net', 'app_file' => '/download/versions.dta', 'app_protocol' => 'native', 'app_page' => 'http://mods.impleri.net/download.php');
	}
}

if ( defined('IN_ADMIN') || in_array($requester, array('posting', 'usercp')) )
{
	// language
	_add_lang('lang_extend_notify', 'notifycp');

	// handler
	include($config->url('includes/aucp/notify_handler');
}

// plugs
$config->set_plug_ins('mod_aucp_notify', array(
	'posting' => array(
		'layer' => 'includes/aucp/notify_plugs',
		'object' => 'notify_posting',
	),
	'privmsg' => array(
		'layer' => 'includes/aucp/notify_plugs',
		'object' => 'notify_privmsg',
	),
	'class_posts' => array(
		'layer' => 'includes/aucp/notify_plugs',
		'object' => 'notify_display',
	),
	'class_versions' => array(
		'object' => 'advnot_version',
	),
));

?>